import Vue from 'vue';
import VueI18n from 'vue-i18n';
import zhCn from '../language/zh-cn.js';
import en from '../language/en.js';
import iviewEn from 'iview/dist/locale/en-US';
import iviewZh from 'iview/dist/locale/zh-CN';
import store from '../store';


const messages = {
  'zh-cn': Object.assign({}, zhCn, iviewZh),
  'en': Object.assign({}, en, iviewEn),
}

Vue.use(VueI18n);
// Vue.locale = () => {};

const i18n = new VueI18n({
  locale: store.state.locale, // 设置地区
  messages, // 设置地区信息
})

export default i18n;